package com.mrd.gtimpframe.repository;

import com.mrd.gtimpframe.entity.GenProtocol;

import java.util.List;
import java.util.Map;

public interface GenProtocolMapper {
    int deleteByPrimaryKey(String id);

    int insert(GenProtocol record);

    int insertSelective(GenProtocol record);

    GenProtocol selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(GenProtocol record);

    int batchUpdateByPrimaryKeySelective(List<GenProtocol> records);

    int updateByPrimaryKey(GenProtocol record);

    /**
     * 根据map进行查询
     * @param parmas
     * @return
     */
    List<GenProtocol> selectByMap(Map<String, Object> parmas);

    /**
     * 根据map进行查询
     * @param parmas
     * @return
     */
    List<String> selectIdByMap(Map<String, Object> parmas);

    /**
     * 根据map进行查询
     * @param parmas
     * @return
     */
    List<String> selectIdByMapAndUniteIdIsNull(Map<String, Object> parmas);

    /**
     * 根据map进行查询
     * 这里查的是一份整的协议下的明细
     * @param parmas
     * @return
     */
    List<String> selectIdByUniteMap(Map<String, Object> parmas);

    GenProtocol selectByIdAndFeeIeType(String id);

    /**
     * 通过多个组件进行查询
     */
    List<GenProtocol> selectByPrimaryKeyList(List<String> ids);

    /**
     * 通过协议ID查询明细
     */
    List<GenProtocol> selectByUniteId(String uniteId);

    List<GenProtocol> selectBySupplierIdAndStatus(String supplierId, String status);

    List<GenProtocol> selectByPortCodeAndStatus(String portCode, String status);

    int updateSupplierIdByUniteId(String supplierId, String uniteId);
}
